<template>
  <Descriptions bordered>
    <DescriptionsItem :span="3" label="滑动窗口类型">{{ detailsProps.slidingWindowType }}</DescriptionsItem>
    <DescriptionsItem :span="3" label="滑动窗口大小">{{ detailsProps.slidingWindowSize }}</DescriptionsItem>
    <DescriptionsItem :span="3" label="调用次数基线">{{ detailsProps.windowSizeUnit }}</DescriptionsItem>
    <DescriptionsItem v-if="detailsProps.slowCallDurationThreshold !== ''" :span="3" label="慢请求熔断">
      请求响应时间: {{ detailsProps.slowCallDurationThreshold }} {{ detailsProps.slowCallTimeUnit }}
      <br />
      慢请求调用阈值: {{ detailsProps.slowCallRateThreshold }}
    </DescriptionsItem>
    <DescriptionsItem v-if="detailsProps.failureRateThreshold !== ''" :span="3" label="错误率阈值熔断">
      错误率阈值: {{ detailsProps.failureRateThreshold }}
    </DescriptionsItem>
  </Descriptions>
</template>
<script lang="ts" setup>
import { Descriptions, DescriptionsItem } from 'ant-design-vue';

const detailsProps = defineProps({
  slidingWindowType: String,
  slidingWindowSize: String,
  windowSizeUnit: String,
  minimumNumberOfCalls: String,
  failureRateThreshold: String,
  slowCallDurationThreshold: String,
  slowCallTimeUnit: String,
  slowCallRateThreshold: String,
});
</script>
